package com.qk.management.aop.annotation;


import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Cacheable {
    // redis缓存key
    String redisKey() default  "";
    // redis缓存key前缀
    String redisKeyPrefix() default "";
    // 缓存redis的key过期时间
    long redisKeyExpireTime() default 0;
    //指定过期时间单位,默认为秒
    TimeUnit redisKeyExpireTimeUnit() default TimeUnit.SECONDS;

    //相当于别名,   用 value相当于 redisKey
//    @AliasFor([attribute = ]"redisKey")
//    String value() default "";
}
